<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>react-demo-05</title>
  </head>
  <style lang="scss">
    .title {
      display: inline-flex;
      border: 1px solid blue;
      border-radius: 3px;
    }
  </style>
  <body>
    <!-- 准备容器 -->
    <div id="main"></div>

    <!-- 引入react核心库 -->
    <script
      type="text/javascript"
      src="https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.development.js"
    ></script>
    <!-- 引入react-dom，用于操作dom -->
    <script
      type="text/javascript"
      src="https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js"
    ></script>
    <!-- 引入babel，用于编译jsx -->
    <script src="https://cdn.bootcdn.net/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>

    <!-- 此处一定要写babel，用于提示babel对该内容进行编译 -->
    <script type="text/babel">
      const VData = ['Angular', 'React', 'Vue'];
      // jsx {} 中只能接受表达式，不能接受if、for、switch等语句。
      const VDom = (
        <div>
          <h1>前端js框架列表</h1>
          <ul>
            {VData.map((value) => (
              <li key={value}>{value}</li>
            ))}
          </ul>
        </div>
      );
      ReactDOM.render(VDom, document.getElementById('main'));
    </script>
  </body>
</html>
